package com.share.base.action;


import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.share.base.dao.QueryFilter;
import com.share.base.utils.JsonUtil;

public class JsonIntercepter extends AbstractInterceptor{


	private static final long serialVersionUID = 1L;

	@Override
	public String intercept(ActionInvocation invoctaion) throws Exception {
		BaseAction baseAction = (BaseAction)invoctaion.getAction();
		String strFilter = baseAction.getStrFilter();
		QueryFilter qf = new QueryFilter();
		if(strFilter!=null){
			JsonUtil.jsonToObject(strFilter,qf);
		}
		RequestContextFactory.instance().createQueryFilter(qf);
		String result = invoctaion.invoke();
		return result;
	}

}
